package com.example.video.common;

/**
 * 自定义请求状态码
 */
public enum ResultStatus {
    SUCCESS(1000, "成功"),

    SYSTEM_ERR(2000, "服务器异常"),
    NO_DATA(2001, "没有数据"),
    INVALID_TOKEN(2002, "登录过期或者无效，请重新登录"),
    PARAM_ERR(2003, "入参非法"),
    NOT_LOGIN(2004, "未登录"),
    NO_ACCESS(2005, "无权访问"),
    ADMIN_AUTHC_ERR(2006, "未登录"),
    ADMIN_AUTHZ_ERR(2007, "没有权限"),

    /* 上传相关错误码 */
    UPLOAD_FAILURE(1101, "上传失败"),
    UPLOAD_SUCCESS(1102, "上传成功");

    /**
     * 返回码
     */
    private int code;

    /**
     * 返回结果描述
     */
    private String message;

    ResultStatus(int code, String message) {
        this.code = code;
        this.message = message;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }
}
